package com.zzr.zzrbackend.controller;

import com.zzr.zzrbackend.pojo.dto.CommonResult;
import com.zzr.zzrbackend.pojo.dto.result.FileUploadListResult;
import com.zzr.zzrbackend.service.FileUploadService;
import jakarta.annotation.Resource;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.multipart.MultipartFile;

import java.util.List;

@RestController
public class FileUploadController {

    @Resource
    private FileUploadService fileUploadService;

    @RequestMapping(value = "api/upload", method = RequestMethod.POST)
    public CommonResult<FileUploadListResult> upload(@RequestBody List<MultipartFile> file, Integer fileType) {
        return fileUploadService.upload(file, fileType);
    }
}
